#include "stdafx.h"
#include "Shrine.h"
#include "..\..\..\EdgeGraphics\Model.h"
#include "..\..\..\EdgeContent\ContentManager.h"
#include "..\..\..\EdgeMath\BoundingBox.h"

void onCollision(void**);

// create a new shrine
Shrine::Shrine(void)
{
	model = ContentManager::GetInstance()->LoadMdl("Content/Models/shrine.mdl");
	model->SetMaterial(ContentManager::GetInstance()->LoadMaterial("Content/Textures/testMaterial.mat"));
	model->setShaderContainer(ContentManager::GetInstance()->LoadShaderPair("AdsLightingVertexShader.cso", "AdsLightingPixelShader.cso"));

	collider = new BoundingBox(position, 30.f);
	OnCollision.Subscribe(Functor<collision_event_handler>(&onCollision, 0));
}

/*virtual*/ Shrine::~Shrine(void)
{
}

/*virtual*/ void Shrine::Update(float dt) /*override*/
{
	((BoundingBox*)collider)->position = position;
	if (scale < 1.f)
		scale += 0.1f;

	GameObject::Update(dt);
}

// a callback for when this object has been interacted with
/*virtual*/ void Shrine::Interact(void) /*override*/
{
	scale = .1f;
}

void onCollision(void** params)
{
}